{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-theme.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}">
    <script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap.min.js' %}"></script>
    <!--[if lt IE 9]>
			<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
			<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
</head>
<body>
<!--Here is the navbar-->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#navbar-collapse-basepage">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="{% url 'homepage' %}" class="navbar-brand">Library</a>
        </div>

        <div class="collapse navbar-collapse" id="navbar-collapse-basepage">
            <ul class="nav navbar-nav">
                <li id="homepage"><a href="{% url 'homepage' %}">主页</a></li>
                {% if user.myuser.permission > 1 %}
                    <li id="add_book"><a href="{% url 'add_book' %}">添加图书</a></li>
                    <li id="add_img"><a href="{% url 'add_img' %}">添加图片</a></li>
                {% endif %}
                <li id="view_book"><a href="{% url 'view_book_list' %}">查看图书</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                {% if user %}
                    <li><p class="navbar-text">欢迎你&nbsp;&nbsp;<span id="base_name">{{ user.myuser.nickname }}</span></p>
                    </li>
                    <li><a href="{% url 'logout' %}">注销</a></li>
                    <li><a href="{% url 'set_password' %}">修改密码</a></li>
                {% else %}
                    <li><a href="{% url 'signup' %}">注册</a></li>
                    <li><a href="{% url 'login' %}">登录</a></li>
                {% endif %}
            </ul>
        </div>

    </div>
</nav>
<!-- /nav -->
<!-- header -->
<header class="jumbotron subhead" id="header-base">
    <div class="container">
        <h1>图书管理系统</h1>
        <h3>&emsp;&emsp;知识改变命运</h3>
    </div>
</header>
<!-- /.header -->
<!-- main part -->
{% block content %}{% endblock %}
<!-- /.main -->

<!-- footer -->
<footer class="footer" role="contentinfo">
    <hr>
    <div class="container">
        <p class="text-center"><strong>HIT-CS</strong></p>
        <p class="text-center">©All rights reserved</p>
        <h5 class="text-center"> Powered by&nbsp;<a href="http://yumendy.com/">Duan Yi</a></h5>
    </div>
</footer>
<!-- /.footer-->
<script type="text/javascript">
    $('#{{active_menu}}').addClass("active");
</script>
</body>
</html>